#!/bin/sh
# @Author: root
# @Date:   2014-07-24 11:46:22
# @Last Modified by:   ldm
# @Last Modified time: 2014-09-30 17:38:53

# local test url
# URL="http://172.16.1.117"
URL="http://localhost"
# URL="http://localhost:8080"

# server test url1
# URL="http://54.179.29.108"
# 
# server test url2
# URL="http://54.255.99.115"

# formal server
URL="https://lifebalanz.oaxis.com"
# URL="http://lifebalanz.oaxis.com"


# make sure the TOKEN and ACCESS_TOKEN are unique!
# TOKEN="L__SpBA17TzT8WgRQpJT"

TOKEN="tbsqQf-wGZu7vY8KtGMD"
ACCESS_TOKEN="F5450EC4DE9B3A23992CE713F72CA8CD"
# shejun
# TOKEN="Q33r_N374dN1ii4eXism"
# ACCESS_TOKEN="DEC7FBFF2AEC9EE6CE6D375F1FAA6507"



# TOKEN="kxmepCgWjfB-rUVKmjzs"

echo "\nsave"
# curl -F update=1 -F token=${TOKEN} -F filedata=@json.zip ${URL}/lifebalanz/save
curl -F token=${TOKEN} -F filedata=@json.zip ${URL}/lifebalanz/save

echo "\ngetdata"
curl -X POST -d "token=${TOKEN}&unit=all"  ${URL}/lifebalanz/getdata

echo "\ngetinfo"
curl -X POST -d "token=${TOKEN}"  ${URL}/lifebalanz/getinfo

echo "\ngetinfolastupdatemark"
curl -X POST -d "token=${TOKEN}"  ${URL}/lifebalanz/getinfolastupdatemark


echo "\ngetupdates"
curl -X POST -d "token=${TOKEN}"  ${URL}/lifebalanz/getupdates


echo "\n getqqupload"
curl -X POST -d "token=${TOKEN}"  ${URL}/lifebalanz/getqqupload

echo "\n lastupdatemark"
curl -X POST -d "token=${TOKEN}"  ${URL}/lifebalanz/lastupdatemark

echo "\n setqqupload"
curl -X POST -d "token=${TOKEN}&access_token=${ACCESS_TOKEN}&is_join=1&lastupdatemark_step=0&lastupdatemark_sleep=0"  ${URL}/lifebalanz/setqqupload

# ######################background running############################

echo "\nupload qqhealth data"
curl ${URL}/qqjiankang/upload

echo "\n qqupload by user"
curl -X POST -d "token=${TOKEN}" ${URL}/qqjiankang/upload

########################feedback test ##############################
# echo "\nsavefeedback"
# curl -X POST -d "token=${TOKEN}&text=feed back texts!!!" ${URL}/lifebalanz/savefeedback

# echo "\ngetfeedback"
# curl -X POST -d "token=${TOKEN}" ${URL}/lifebalanz/getfeedback











########################third party ##############################
# EMAIL="duomin234@gmail.com" 
# PASSWORD="12345678"
# THIRD_TOKEN="f6ced6bb02f90c128ece0ddc52b8b63e"

# echo "\nthirdparty - getdata\n"
# curl -X POST -d "flag=igogohome&date=8&unit=month&token=${THIRD_TOKEN}" ${URL}/thirdparty/getdata


########################sys test ##############################
# echo "\ndev2live_do"
# curl  ${URL}/sys/dev2live_do










echo "\n"
